﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using A2DFramework.SQLDispatcherService;
using A2DFramework.SQLDispatcherService.Configuration;
using System.Data.SqlClient;

namespace Demo.SqlDispatcherConsole
{
    class Query2
    {
        private IRepository repository;

        public Query2()
        {
            repository = new EFRepository(null);
        }

        public void Test0()
        {
            var connectionString = ConnectionManager.GetDbConnectionString(ConnectionOption.Create("DB1", SqlExecuteType.Write));

            repository.Insert<string>(connectionString, "testing");
        }

        public void Test1()
        {
            //SqlDataReader reader = SqlHelperCoordinator.ExecuteReader("DB1", "dbo.up2_select1", 100);
            //reader.Read();
            //reader.Close();
            //reader.Dispose();
        }

        public void Test2()
        {
            //SqlDataReader reader = SqlHelperCoordinator.ExecuteReader("DB1", "dbo.up2_select2  --Sales", 100);
            //reader.Read();
            //reader.Close();
            //reader.Dispose();
        }
    }
}
